package ch6.pool;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author LuHuanCheng
 * 类说明：使用JDK的线程池ThreadPoolExecutor
 */
public class UseThreadPoolExecutor {
    public static void main(String[] args) {
        ExecutorService executorService = new ThreadPoolExecutor(2, 4,
                3, TimeUnit.SECONDS,
                new ArrayBlockingQueue<Runnable>(10),
                new ThreadPoolExecutor.AbortPolicy());
        System.out.println(executorService);
    }
}